/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.assignment.Qusetion1.salaried;

import za.ac.cput.assignment.Qusetion1.employee.Employee;

/**
 *
 * @author Andisiwe
 */
public final class SalariedEmployee  extends Employee
{
    
    private double weeklySalary;
    
    
    public SalariedEmployee(String first, String last, String ssn, double Salary)
    {
        super(first, last,ssn);
        setWeeklySalary(Salary);
    }

    /**
     * @return the weekelySalary
     */
    public void setWeeklySalary( double Salary)
    {
        weeklySalary = Salary < 0.0 ? 0.0 : Salary;
    }
    public double getWeeklySalary() 
    {
        return weeklySalary;
    }
  

    @Override
    public double getPaymentAmount() 
    {
        return getWeeklySalary();
    }
    @Override
    public String toString()
    {
        return String.format("salaried emloyee: %s\n%s:%S,.2f",
                 super.toString(),"weekly salary", getWeeklySalary());
    }
   
    
}
